<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var num = 1526.5;
        var bai = parseInt(num / 100);
        var aa = num % 100;
        var ws = parseInt(aa / 50);
        var aa1 = aa % 50;
        var ersy = parseInt(aa1 / 20);
        var aa2 = aa1 % 20;
        var yysy = parseInt(aa2 / 10);
        var aa3 = aa2 % 10;
        var wy = parseInt(aa3 / 5);
        var aa4 = (aa3 % 5);
        var yyy = parseInt(aa4 / 1);
        var aa5 = (aa4 % 1);
        var wj = parseInt(aa5 / 0.5);
        var aa6 = (aa5 % 0.5);
        var yj = parseInt(aa6 / 0.1);
        alert(num + '元需要' + '100元' + bai + '张' + '50元' + ws + '张' + '20元' + ersy + '张' + '10元' + yysy + '张' + '5元' + wy + '张' + '1元' + yyy + '张' + '5角' + wj + '张')
    </script>
</body>

</html>